const express = require('express');
const router = express.Router();

router.get('/forCurrentUser', (req, res) => {
    const content = [];
    for(let i = 0; i < 40; i++) content.push({
        id: `${i + 1}`,
        code: 'string',
        brandCode: 'string',
        brandName: 'string',
        dealerCode: 'string',
        dealerName: 'string',
        invoiceCode: 'string',
        invoicedDate: '2019-09-11T10:52:54.939Z',
        status: 1,
        claimType: 1,
        paymentMethod: 1,
        currency: 1,
        claimFee: 1,
        claimAmount: 1,
        createTime: '2019-09-11T10:52:54.939Z',
        approverTime: '2019-09-11T10:52:54.939Z',
        confirmTime: '2019-09-11T10:52:54.939Z',
        options: [
            'approve',
            'confirm',
        ]
    });
    res.json({
        message: '',
        payload: {
            content,
            totalElements: 40,
        }
    });
});
router.get('/:id', (req, res) => {
    res.json(
        {
            message: 'string',
            payload: {
                id: '1',
                code: 'string',
                branchCode: 'string',
                branchName: 'string',
                brandCode: 'string',
                brandName: 'string',
                dealerCode: 'string',
                dealerName: 'string',
                claimCode: 'string',
                claimCreateDate: '2019-09-11T10:56:18.276Z',
                invoiceCode: 'string',
                invoicedDate: '2019-09-11T10:52:54.939Z',
                claimAmount: 1,
                claimFee: 1,
                receivingDealerName: 'string',
                address: 'string',
                contactNumber: 'string',
                destination: 'string',
                status: 1,
                creatorName: 'string',
                createTime: '2019-09-11T10:56:18.277Z',
                confirmorName: 'string',
                confirmTime: '2019-09-11T10:56:18.277Z',
                claimType: 1,
                currency: 1,
                paymentMethod: 1,
                receiptDate: '2019-09-11T10:56:18.277Z',
                shipmentDate: '2019-09-11T10:56:18.277Z',
                actualArrivalDate: '2019-09-11T10:56:18.277Z',
                rowVersion: 'string',
                options: [
                    'approve',
                    'confirm',
                ],
                details: [
                    {
                        id: '1',
                        packingListCode: 'string',
                        partSaleOrderCode: 'string',
                        partCode: 'string',
                        partName: 'string',
                        claimAmount: 1,
                        price: 1,
                        claimFee: 1,
                        partClaimCode: 1,
                        claimReason: 1,
                        result: 1
                    }
                ]
            }
        }
    );
});

router.put('/:id/approve', (req, res) => {
    res.json({
        message: '审核成功'
    });
});

router.put('/:id/confirm', (req, res) => {
    res.json({
        message: '确认成功'
    });
});

module.exports = router;
